<f:subview xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:c="http://java.sun.com/jstl/core"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:nxl="http://nuxeo.org/nxforms/layout"
  xmlns:nxd="http://nuxeo.org/nxweb/document"
  xmlns:nxu="http://nuxeo.org/nxweb/util"
  xmlns:nxp="http://nuxeo.org/nxweb/pdf">

<c:if test="false">
  displays a content view using PDF JSF library.

  accepted parameters:
  - from request: contentViewName, currentPage, pageSize, contentViewState
</c:if>

  <nxu:set var="contentViewName" value="#{request.getParameter('contentViewName')}">
  <nxu:set var="currentPage" value="#{request.getParameter('currentPage')}">
  <nxu:set var="pageSize" value="#{request.getParameter('pageSize')}">
  <nxu:set var="contentViewState" value="#{request.getParameter('contentViewState')}">

  <nxu:set var="contentView"
    value="#{contentViewRestActions.restoreContentView(contentViewName, nxu:test(!empty currentPage, currentPage, -1), nxu:test(!empty pageSize, pageSize, -1), null, contentViewState)}"
    cache="true">
  <nxu:set var="selectedResultLayoutColumns"
    value="#{nxu:test(selectedResultLayoutColumns == null, contentView.currentResultLayoutColumns, selectedResultLayoutColumns)}"
    cache="true">


    <nxp:document title="#{titleOrId}" orientation="landscape"
      fileName="#{contentViewName}.pdf">

    <c:set var="contentViewTitle"
      value="#{nxu:test(contentView.translateTitle, messages[contentView.title], contentView.title)}" />
    <c:set var="titleOrId" value="#{nxu:test(empty contentViewTitle, contentViewName, contentViewTitle)}" />

      <f:facet name="header">
        <nxp:footer borderWidthTop="1" borderColorTop="blue"
          borderWidthBottom="0" alignment="center">
          #{titleOrId} [<nxp:pageNumber />]
        </nxp:footer>
      </f:facet>

      <nxp:paragraph>#{titleOrId}</nxp:paragraph>

      <ui:include src="/incl/export/content_view_pdf_template.xhtml" />

    </nxp:document>

  </nxu:set>
  </nxu:set>
  </nxu:set>
  </nxu:set>
  </nxu:set>
  </nxu:set>

</f:subview>